<div id="productsdiv">
<input type="text" id="products" size="100"  class="ui-autocomplete-input ui-corner-all" autocomplete="on" value="<?=getObjByKey("evigie_products","lib_$LANG","id",$currentObject->productid) ?>"/>
<input type="hidden" id="ButterflyPortal_data_PRODUCTID" name="ButterflyPortal_data_PRODUCTID" value="<?=$currentObject->productid ?>"/>
</div>
<script type="text/javascript">
//$(document).ready(function() {});
  $(function() {

 
    $( "#products" ).autocomplete({
      minLength: 0,
      source: '/portlet.php?app=evigieutils&operation=getproducts',
     
      select: function( event, ui ) {
        $( "#products" ).val( ui.item.label );
        $( "#ButterflyPortal_data_PRODUCTID" ).val( ui.item.value );
 
        return false;
      }
    })
  
  });

$("#el_PRODUCTID").html($("#productsdiv"));
</script>
